﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Com.Charence.PassManager.Common;

namespace Com.Charence.PassManager.UI.Web.Common
{
    [Authorize]
    public class BaseController : Controller
    {
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (AppContext.Current.LoginUserID <= 0)
            {
                System.Web.Security.FormsAuthentication.SignOut();
                filterContext.Result = RedirectToAction("Login", "Authenticate");
            }
            base.OnActionExecuting(filterContext);
        }
    }
}